package org.rain.core.codegen;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * created by yangtong on 2025/4/6 下午12:01
 * <br/>
 * 数据库连接操作
 */
public interface IConnectionService {

    /**
     * 获取一个连接
     */
    Connection getConnection() throws SQLException;

    /**
     * 通过账号密码获取一个连接
     */
    Connection getConnection(String username, String password) throws SQLException;

    /**
     * 关闭一个连接
     */
    void closeConnection(Connection connection) throws SQLException;

    void closeResultSet(ResultSet set) throws SQLException;

}
